package com.eastfair.pay.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.eastfair.annotation.model.EchoVO;
import com.eastfair.core.base.entity.Entity;
import com.eastfair.database.mybatis.typehandler.M9EncryptHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 发票抬头
 * </p>
 *
 * @author clm
 * @since 2022-06-08
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName(value = "pay_invoice_title",autoResultMap = true)
@ApiModel(value = "InvoiceTitle", description = "发票抬头")
@AllArgsConstructor
public class InvoiceTitle extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 业务系统客户id
     */
    @ApiModelProperty(value = "业务系统客户id")
    @TableField(value = "cutomer_id")
    @Excel(name = "业务系统客户id")
    private Long cutomerId;

    /**
     * 发票抬头
     */
    @ApiModelProperty(value = "发票抬头")
    @Size(max = 255, message = "发票抬头长度不能超过255")
    @TableField(value = "invoice_title", condition = LIKE)
    @Excel(name = "发票抬头")
    private String invoiceTitle;

    /**
     * 税号
     */
    @ApiModelProperty(value = "税号")
    @Size(max = 255, message = "税号长度不能超过255")
    @TableField(value = "invoice_duty_paragraph", condition = LIKE)
    @Excel(name = "税号")
    private String invoiceDutyParagraph;

    /**
     * 开票单位地址
     */
    @ApiModelProperty(value = "开票单位地址")
    @Size(max = 255, message = "开票单位地址长度不能超过255")
    @TableField(value = "company_address", condition = LIKE)
    @Excel(name = "开票单位地址")
    private String companyAddress;

    /**
     * 开票单位电话
     */
    @ApiModelProperty(value = "开票单位电话")
    @Size(max = 255, message = "开票单位电话长度不能超过255")
    @TableField(value = "company_tel", condition = LIKE,typeHandler = M9EncryptHandler.class)
    @Excel(name = "开票单位电话")
    private String companyTel;

    /**
     * 银行账号
     */
    @ApiModelProperty(value = "银行账号")
    @Size(max = 255, message = "银行账号长度不能超过255")
    @TableField(value = "bank_account_num", condition = LIKE)
    @Excel(name = "银行账号")
    private String bankAccountNum;

    /**
     * 开户行
     */
    @ApiModelProperty(value = "开户行")
    @Size(max = 255, message = "开户行长度不能超过255")
    @TableField(value = "bank_name", condition = LIKE)
    @Excel(name = "开户行")
    private String bankName;

    /**
     * 系统code
     */
    @ApiModelProperty(value = "系统code")
    @Size(max = 20, message = "系统code长度不能超过20")
    @TableField(value = "system_code", condition = LIKE)
    @Excel(name = "系统code")
    private String systemCode;


    @Builder
    public InvoiceTitle(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    Long cutomerId, String invoiceTitle, String invoiceDutyParagraph, String companyAddress, String companyTel, String bankAccountNum, 
                    String bankName, String systemCode) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.cutomerId = cutomerId;
        this.invoiceTitle = invoiceTitle;
        this.invoiceDutyParagraph = invoiceDutyParagraph;
        this.companyAddress = companyAddress;
        this.companyTel = companyTel;
        this.bankAccountNum = bankAccountNum;
        this.bankName = bankName;
        this.systemCode = systemCode;
    }

}
